package com.example.demoapi.api.controller;


import com.example.demoapi.api.aop.UserBalanceLog;
import com.example.demoapi.api.pojo.Result;
import com.example.demoapi.api.service.WalletServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Hu
 * @date 2023/2/6
 * @apiNote
 */
@RestController()
@RequestMapping("/operation-user-balance")
@UserBalanceLog
public class UserController {

    @Autowired
    private WalletServiceImpl walletService;

    @RequestMapping("/userConsumptionOneHundredYuan/{userId}/{orderId}")
    public Result userConsumptionOneHundredYuan(@PathVariable("userId") int userId,
                                                @PathVariable("orderId") int orderId) {
        return walletService.userConsumptionOneHundredYuan(userId,orderId);
    }

    @RequestMapping("/userRefundsTwentyYuan/{userId}/{orderId}")
    public Result userRefundsTwentyYuan(@PathVariable("userId") int userId,
                                        @PathVariable("orderId") int orderId) {
        return walletService.userRefundsTwentyYuan(userId,orderId);
    }

}
